/*
 Navicat Premium Data Transfer

 Source Server         : 本地
 Source Server Type    : MySQL
 Source Server Version : 50728
 Source Host           : localhost:3306
 Source Schema         : im

 Target Server Type    : MySQL
 Target Server Version : 50728
 File Encoding         : 65001

 Date: 07/11/2020 13:33:00
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for friends
-- ----------------------------
DROP TABLE IF EXISTS `friends`;
CREATE TABLE `friends` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `user_fid` int(11) NOT NULL,
  `created_at` int(11) unsigned DEFAULT NULL,
  `updated_at` int(11) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=FIXED;

-- ----------------------------
-- Records of friends
-- ----------------------------
BEGIN;
INSERT INTO `friends` VALUES (1, 3, 2, 1600936541, 1600936541);
INSERT INTO `friends` VALUES (2, 2, 3, 1600936541, 1600936541);
INSERT INTO `friends` VALUES (3, 3, 1, 1600936545, 1600936545);
INSERT INTO `friends` VALUES (4, 1, 3, 1600936545, 1600936545);
INSERT INTO `friends` VALUES (5, 2, 4, 1602560404, 1602560404);
INSERT INTO `friends` VALUES (6, 4, 2, 1602560404, 1602560404);
INSERT INTO `friends` VALUES (7, 2, 5, 1602560518, 1602560518);
INSERT INTO `friends` VALUES (8, 5, 2, 1602560518, 1602560518);
INSERT INTO `friends` VALUES (9, 2, 6, 1602560540, 1602560540);
INSERT INTO `friends` VALUES (10, 6, 2, 1602560540, 1602560540);
INSERT INTO `friends` VALUES (11, 3, 4, 1602560736, 1602560736);
INSERT INTO `friends` VALUES (12, 4, 3, 1602560736, 1602560736);
INSERT INTO `friends` VALUES (13, 2, 7, 1602579178, 1602579178);
INSERT INTO `friends` VALUES (14, 7, 2, 1602579178, 1602579178);
COMMIT;

-- ----------------------------
-- Table structure for messages
-- ----------------------------
DROP TABLE IF EXISTS `messages`;
CREATE TABLE `messages` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `msg_id` varchar(30) COLLATE utf8mb4_bin DEFAULT NULL,
  `user_id` int(11) unsigned DEFAULT NULL COMMENT '发送者id',
  `dst_id` int(11) unsigned DEFAULT NULL COMMENT '接收者id',
  `content` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '消息内容',
  `pic` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '图片',
  `is_r` tinyint(2) unsigned DEFAULT '0' COMMENT '是否已读 1是 0 未',
  `created_at` int(11) unsigned DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `msg_id` (`msg_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) COLLATE utf8mb4_bin DEFAULT NULL,
  `sex` tinyint(2) unsigned DEFAULT '0',
  `created_at` int(11) unsigned DEFAULT NULL,
  `updated_at` int(11) unsigned DEFAULT NULL,
  `password` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `avatar` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'lcz123', 1, NULL, NULL, '4297f44b13955235245b2497399d7a93', NULL);
INSERT INTO `user` VALUES (2, 'lcz1', 1, 1599466568, 1599466568, '4297f44b13955235245b2497399d7a93', 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600770677370&di=1115f3053438cb809f0117ca986e727f&imgtype=0&src=http%3A%2F%2Fa3.att.hudong.com%2F57%2F28%2F01300000921826141405283668131.jpg');
INSERT INTO `user` VALUES (3, 'lcz2', 0, 1600161210, 1600161210, '4297f44b13955235245b2497399d7a93', 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600770677370&di=1115f3053438cb809f0117ca986e727f&imgtype=0&src=http%3A%2F%2Fa3.att.hudong.com%2F57%2F28%2F01300000921826141405283668131.jpg');
INSERT INTO `user` VALUES (4, 'lcz3', 0, 1600161246, 1600161246, '4297f44b13955235245b2497399d7a93', NULL);
INSERT INTO `user` VALUES (5, 'lcz4', 0, 1600161268, 1600161268, '4297f44b13955235245b2497399d7a93', NULL);
INSERT INTO `user` VALUES (6, 'lcz5', 0, 1600328527, 1600328527, '4297f44b13955235245b2497399d7a93', NULL);
INSERT INTO `user` VALUES (7, 'lcz6', 0, 1600328570, 1600328570, '4297f44b13955235245b2497399d7a93', NULL);
COMMIT;

-- ----------------------------
-- Table structure for user_group
-- ----------------------------
DROP TABLE IF EXISTS `user_group`;
CREATE TABLE `user_group` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned NOT NULL,
  `g_name` varchar(30) COLLATE utf8mb4_bin NOT NULL,
  `created_at` int(11) unsigned DEFAULT NULL,
  `updated_at` int(11) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user_group
-- ----------------------------
BEGIN;
INSERT INTO `user_group` VALUES (1, 1, '居酒屋', 1599534738, 1599534738);
INSERT INTO `user_group` VALUES (2, 1, '居酒屋1', 1599534741, 1599534741);
INSERT INTO `user_group` VALUES (3, 1, '居酒屋2', 1599534742, 1599534742);
INSERT INTO `user_group` VALUES (4, 2, '撸啊撸', 1599634898, 1599634898);
COMMIT;

-- ----------------------------
-- Table structure for user_group_relations
-- ----------------------------
DROP TABLE IF EXISTS `user_group_relations`;
CREATE TABLE `user_group_relations` (
  `user_id` int(11) unsigned DEFAULT NULL,
  `user_group_id` int(11) unsigned DEFAULT NULL,
  UNIQUE KEY `user_group_id` (`user_id`,`user_group_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=FIXED;

-- ----------------------------
-- Records of user_group_relations
-- ----------------------------
BEGIN;
INSERT INTO `user_group_relations` VALUES (1, 1);
INSERT INTO `user_group_relations` VALUES (1, 2);
INSERT INTO `user_group_relations` VALUES (1, 3);
INSERT INTO `user_group_relations` VALUES (2, 1);
INSERT INTO `user_group_relations` VALUES (2, 4);
INSERT INTO `user_group_relations` VALUES (3, 1);
INSERT INTO `user_group_relations` VALUES (3, 4);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
